package com.zyzd.general.module.managerlist;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.zyzd.general.R;
import com.zyzd.general.entity.local.ManagerListEntity;
import com.zyzd.retrofit.base.BaseAdapter;

/**
 * Created by lzy on 2018/5/15 0015.
 * description ${管理，列表 Adapter}
 */
class ManagerListAdapter extends BaseAdapter<ManagerListAdapter.BaseManagerListHolder, ManagerListEntity> {

    public ManagerListAdapter(Context context) {
        super(context);
    }

    @NonNull
    @Override
    public BaseManagerListHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new BaseManagerListHolder(mInflater.inflate(R.layout.item_base_manager_list, parent, false));
    }

    @Override
    public void onBindHolder(@NonNull BaseManagerListHolder holder, final int position) {
        holder.btn.setText(getItem(position).getText());
    }

    static class BaseManagerListHolder extends RecyclerView.ViewHolder {

        private final Button btn;

        BaseManagerListHolder(View itemView) {
            super(itemView);
            btn = itemView.findViewById(R.id.btn);
        }
    }
}
